package com.zdd.spring.framework.context;

import com.zdd.spring.framework.beans.MyBeanWrapper;
import com.zdd.spring.framework.beans.config.MyBeanDefinition;
import com.zdd.spring.framework.beans.support.MyBeanDefinitionReader;

import java.util.HashMap;
import java.util.Map;

/**
 * @version 1.0
 * @Author: carl
 * @Description: 共产类，负责Bean创建和依赖注入
 * @Date: Create in 14:15 2020/4/9 0009
 */
public class MyApplicationContext {

    private MyBeanDefinitionReader reader;

    private Map<String,MyBeanDefinition> beanDefinitionMap  = new HashMap<String,MyBeanDefinition>();

    private Map<String, MyBeanWrapper> factoryBeanInstanceCache = new HashMap<String, MyBeanWrapper>();

    private Map<String,Object> factoryBeanObjectCache = new HashMap<String, Object>();

    public MyApplicationContext(String... configLocations){ 

        // 1加载配置文件

        reader = new MyBeanDefinitionReader(configLocations);
    }
}
